package dao;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import pojo.SysM;

import java.util.List;


@Repository
public interface SysMMapper {

    /**
     *
     * @param username
     * @return
     */
    @Select("select * from sys_m where username = #{username}")
    SysM getOne(@Param("username") String username);

    @Insert("insert into sys_m(id,username,password,name,manager,img) values(#{id},#{username},#{password},#{name},#{manager},#{img})")
    Integer add(SysM sysM);

    @Delete("delete from sys_m where id = #{id}")
    Integer del(String id);

    @Update("update sys_m set password = #{password}, name = #{name},manager=#{manager},img=#{img} where username=#{username}")
    Integer change(SysM sysM);

    @Select("select * from sys_m")
    List<SysM> getAll();
}
